import request from '@/utils/request'

// 查询门类树列表
export function listGROUPTree(query) {
  return request({
    url: '/manage/model/getcatemodeltree',
    method: 'get',
    params: query
  })
}

// 新增门类树
export function addGroupTree(data) {
  return request({
    url: '/manage/model',
    method: 'post',
    data: data
  })
}

// 查询门类树详细
export function getGroupTree(ID) {
  return request({
    url: '/manage/model/' + ID,
    method: 'get'
  })
}

//修改门类树
export function updateGroupTree(data) {
  return request({
    url: '/manage/model',
    method: 'put',
    data: data
  })
}

// 删除门类树
export function delGroupTree(ID) {
  return request({
    url: '/manage/model/' + ID,
    method: 'delete'
  })
}

// 获取元数据方案
export function metaData(query) {
  return request({
    url: '/manage/mdataGroup/list',
    method: 'get',
    params: query
  })
}

// 保存元数据方案信息
export function saveMetaData(query) {
  return request({
    url: '/manage/model/bindgroup',
    method: 'post',
    params: query
  })
}

// 获取元数据方案信息
export function getMetaData(groupId) {
  return request({
    url: '/manage/mdataGroup/' + groupId,
    method: 'get'
  })
}

// 查询档号规则
export function getCodeRule(query) {
  return request({
    url: '/manage/coderule/list',
    method: 'get',
    params: query
  })
}

// 新增档号规则
export function addCodeRule(data) {
  return request({
    url: '/manage/coderule',
    method: 'post',
    data: data
  })
}

//修改档号规则
export function updateCodeRule(data) {
  return request({
    url: '/manage/coderule',
    method: 'put',
    data: data
  })
}

// 删除档号规则
export function delCodeRole(ID) {
  return request({
    url: 'manage/coderule/' + ID,
    method: 'delete'
  })
}

// 获取元数据方案明细---档号定义下拉框
export function metaList(query) {
  return request({
    url: '/manage/mdataList/listAll',
    method: 'get',
    params: query
  })
}

// 保存档号规则明细
export function addRoleDetail(data){
  return request({
    url: '/manage/codelist',
    method: 'post',
    data: data
  })
}

// 获取档号规则明细
export function roleDetailList(type,ID) {
  return request({
    url: '/manage/codelist/getdetail/'+type+'/'+ID,
    method: 'get'
  })
}

//修改档号规则明细
export function updateRoleDetail(data) {
  return request({
    url: '/manage/codelist',
    method: 'put',
    data: data
  })
}

// 获取应用定义的模块
export function listMenu(id) {
  return request({
    url: '/manage/applymodel/getmenu/' + id,
    method: 'get'
  })
}

// 获取应用定义的穿梭框数据
export function getmdatalist(data) {
  return request({
    url: '/manage/applymodel/getmdatalist',
    method: 'post',
    data: data
  })
}

// 获取应用定义列表
export function getApply(query){
  return request({
    url: '/manage/applymodel/listmenu',
    method: 'get',
    params: query
  })
}

// 应用定义增加模块
export function addApply(data) {
  return request({
    url: '/manage/applymodel/addmultiplemenu',
    method: 'post',
    data: data
  })
}

// 应用定义删除模块
export function delApply(categoryId, applyId) {
  return request({
    url: '/manage/applymodel/' + categoryId + '/' +applyId,
    method: 'delete'
  })
}
// 应用定义all删除模块
export function delArrApply(data) {
  return request({
    url: '/manage/applymodel/deletebycatemenu',
    method: 'post',
    data:data
  })
}

//应用定义复制
export function copyApply(data) {
  return request({
    url: '/manage/applymodel/clonefield',
    method: 'post',
    data: data
  })
}

// 添加应用定义明细
export function addApplyDetail(data) {
  return request({
    url: '/manage/applymodel',
    method: 'post',
    data: data
  })
}

// 获取应用定义数据
export function getApplyDetail(categoryId, menuId) {
  return request({
    url: '/manage/applymodel/'+menuId+'/'+categoryId,
    method: 'get'
  })
}

// 获取应用定义明细
export function fieldlist(query) {
  return request({
    url: '/manage/applymodel/fieldlist',
    method: 'get',
    params: query
  })
}


//分类方法  获取元数据明细
export function listforshy2(data) {
  return request({
    url: '/manage/mdataList/listforshy?pageNum='+data.pageNum+'&pageSize='+data.pageSize,
    method: 'post',
    data: data
  })
}
//把元数据添加到三合一表
export function addmdatatoshy2(data) {
  return request({
    url: '/manage/mdataList/addmdatatoshy',
    method: 'post',
    data: data
  })
}
//在三合一中删除元数据
export function deletemdatafromshy2(data) {
  return request({
    url: '/manage/mdataList/deletemdatafromshy',
    method: 'post',
    data: data
  })
}
//添加制度
export function addzd2(data) {
  return request({
    url: '/manage/gdfwandbgqx/addzd',
    method: 'post',
    data: data
  })
}
//获取制度树
export function gdfwandbgqxTree(id) {
  return request({
    url: '/manage/gdfwandbgqx/gettree/'+id,
    method: 'get',
  })
}
//获取条件列表(制度id)
export function getzd2(id) {
  return request({
    url: '/manage/gdfwandbgqx/getzd?id='+id,
    method: 'POST',
  })
}
//制度树修改删除
export function gdfwandbgqxEditzd2(data) {
  return request({
    url: '/manage/gdfwandbgqx/editzd',
    method: 'POST',
    data:data
  })
}


//制度树table表格列表
export function gettable(parentId, categoryId) {
  return request({
    url: '/manage/gdfwandbgqx/gettable/'+ parentId + '/' +categoryId,
    method: 'GET',
  })
}

//添加条件
export function addtj2(data) {
  return request({
    url: '/manage/gdfwandbgqx/addtj',
    method: 'POST',
    data:data
  })
}
//修改条件
export function edittj2(data) {
  return request({
    url: '/manage/gdfwandbgqx/edittj',
    method: 'POST',
    data:data
  })
}



//获取条件列表(制度id)
export function gettjtable2(data) {
  return request({
    url: '/manage/gdfwandbgqx/gettjtable?zdId='+data.id+'&type='+data.typedata+'&pageNum='+data.pageNum+'&pageSize='+data.pageSize,
    method: 'GET',
  })
}

//获取条件sql
export function gettjsql2(query) {
  return request({
    url: '/manage/gdfwandbgqx/gettjsql',
    method: 'GET',
    params: query
  })
}


//删除条件
export function deletetj2(id) {
  return request({
    url: '/manage/gdfwandbgqx/delete/'+id,
    method: 'GET',
  })
}


